package com.bluesea.report.controller;

import java.util.ArrayList;
import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.alibaba.fastjson.JSONArray;
import com.bluesea.report.entity.Menu;
import com.bluesea.report.service.menu.impl.MenuServiceImpl;

@Controller
@RequestMapping("/menu")
public class MenuController {
	
	@Autowired
	private MenuServiceImpl menuServiceImpl;

	
	@RequestMapping(value = "", method=RequestMethod.GET)
	@ResponseBody
	public String getMenuAll() {
		List<Menu>menuList = new ArrayList<Menu>();
		System.out.println("----> 请求菜单数据 <----");
		
		try {
			menuList = menuServiceImpl.getMenuAll();
		} catch (Exception e) {
			e.printStackTrace();
		}
		return JSONArray.toJSONString(menuList);
	}
}
